package com.dragon.task.service;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dragon.task.dao.TaskExecuteExplainMapper;
import com.dragon.task.entity.AcTaskExecuteExplainEntity;
@Service
public class TaskExecuteExplainServiceImpl implements ITaskExecuteExplainDragonService{
	@Autowired
	private TaskExecuteExplainMapper taskExecuteExplainMapper;
	

	@Override
	public void insertTaskExecuteExplain(AcTaskExecuteExplainEntity entity) {
		taskExecuteExplainMapper.insertSelective(entity);
	}

	@Override
	public void updateTaskExecuteExplain(AcTaskExecuteExplainEntity entity) {
		taskExecuteExplainMapper.updateByPrimaryKeySelective(entity);
	}


	@Override
	public Long insertInfo(String className, String methodName, String status,
			Date startTime) {
		AcTaskExecuteExplainEntity entity = new AcTaskExecuteExplainEntity();
		entity.setClassName(className);
		entity.setMethodName(methodName);
		entity.setStartTime(startTime);
		entity.setStatus(status);
		taskExecuteExplainMapper.insertSelective(entity);
		return entity.getId();
	}

	@Override
	public void updateInfo(Long id, String status,Date endTime) {
		AcTaskExecuteExplainEntity entity = new AcTaskExecuteExplainEntity();
		entity.setId(id);
		entity.setStatus(status);
		entity.setEndTime(endTime);
		taskExecuteExplainMapper.updateByPrimaryKeySelective(entity);
	}
}
